import {doGet, doPost} from '@/http/request'

const URL_MAP = {
  "search": "/api/user/search",
  "detail": "/api/user/detail",
  "modify": "/api/user/modify",
  "remove": "/api/user/remove",
  "getAvatar": "/api/user/download/avatar/"
}

// 列表
export function search() {
  return doGet(URL_MAP.search, { page: 0, size: 20 })
}
// 详情
export function detail(id) {
  return doGet(URL_MAP.detail, {id})
}

// 修改
export function modify(userInfo={}) {
  return doPost(URL_MAP.modify, userInfo)
}

export function remove(id) {
  return doPost(URL_MAP.remove+"?id="+id)
}

export function avatar(id) {
  return doGet(URL_MAP.getAvatar+id, {})
}

